/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package InterfazGrafica;

import com.cepardov.Utilidades.FuncionesSQL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;

/**
 *
 * @author cepardov
 */
public class MantenedorVehiculos extends javax.swing.JInternalFrame {
    FuncionesSQL data=new FuncionesSQL();
    Object[][] dtPrev;
    Object[][] dato;
    int fila;
    public int idMarca;
    /**
     * Creates new form MantenedorVehiculos
     */
    public MantenedorVehiculos() {
        initComponents();
        this.updateTablaMarca();
        this.updateTablaModelo();
        this.getComboMarcas();
    }
    
    private void updateTablaMarca(){  
        String[] columNames = {"ID Marca","Nombre Marca"};  
        dtPrev = data.getMarca();
        DefaultTableModel datos = new DefaultTableModel(dtPrev,columNames);                        
        tablaMarca.setModel(datos); 
        TableColumn columna = tablaMarca.getColumn("ID Marca");
    }
    
    private void updateTablaModelo(){  
        String[] columNames = {"ID Modelo","ID Marca","Nombre Marca"};  
        dtPrev = data.getModelo();
        DefaultTableModel datos = new DefaultTableModel(dtPrev,columNames);                        
        tablaModelo.setModel(datos); 
        TableColumn columna = tablaModelo.getColumn("ID Modelo");
    }
    
    private void getComboMarcas(){
        try{
            DefaultComboBoxModel modeloCombo = new DefaultComboBoxModel();
            Class.forName("com.mysql.jdbc.Driver");
            Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost/BDSis", "root", "");
            Statement st = conexion.createStatement();
            ResultSet rs = st.executeQuery("SELECT * FROM marca");
            modeloCombo.addElement("Seleccione");
            while (rs.next()) {
                modeloCombo.addElement(rs.getObject("nombre"));
            }
            rs.close();
            this.cbMarca.setModel(modeloCombo);
        } catch (SQLException ex) {
            Logger.getLogger(Escritorio.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Escritorio.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtidmarca = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        txtnombremarca = new javax.swing.JTextField();
        btnguardamarca = new javax.swing.JButton();
        btnmodificamarca = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tablaMarca = new javax.swing.JTable();
        jPanel4 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        txtidmodelo = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        cbMarca = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        txtnombremodelo = new javax.swing.JTextField();
        btnmodificamodelo = new javax.swing.JButton();
        btnguardamodelo = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tablaModelo = new javax.swing.JTable();

        setClosable(true);
        setTitle("Mantenedor de Vehículos");

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Panel de Edición"));

        jLabel1.setText("ID");

        txtidmarca.setEditable(false);

        jLabel2.setText("Nombre");

        btnguardamarca.setText("Guardar");
        btnguardamarca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnguardamarcaActionPerformed(evt);
            }
        });

        btnmodificamarca.setText("Modificar");
        btnmodificamarca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnmodificamarcaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtidmarca, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtnombremarca, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(btnmodificamarca)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnguardamarca)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtidmarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(txtnombremarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnguardamarca)
                    .addComponent(btnmodificamarca))
                .addContainerGap())
        );

        tablaMarca.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tablaMarca.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tablaMarcaMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tablaMarca);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jScrollPane1)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 68, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Crear/Edición Marca", jPanel2);

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Panel de Edición"));

        jLabel3.setText("ID");

        txtidmodelo.setEditable(false);

        jLabel4.setText("Seleccione Marca");

        cbMarca.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cbMarca.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbMarcaItemStateChanged(evt);
            }
        });

        jLabel5.setText("Nombre Modelo");

        btnmodificamodelo.setText("Modificar");
        btnmodificamodelo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnmodificamodeloActionPerformed(evt);
            }
        });

        btnguardamodelo.setText("Guardar");
        btnguardamodelo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnguardamodeloActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtidmodelo, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cbMarca, 0, 194, Short.MAX_VALUE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtnombremodelo))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(btnmodificamodelo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnguardamodelo)))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(txtidmodelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(cbMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(txtnombremodelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnmodificamodelo)
                    .addComponent(btnguardamodelo))
                .addGap(15, 15, 15))
        );

        tablaModelo.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tablaModelo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tablaModeloMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tablaModelo);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jScrollPane2)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 31, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Crear/Editar Modelo", jPanel4);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1)
                .addGap(17, 17, 17))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnguardamarcaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnguardamarcaActionPerformed
        // TODO add your handling code here:
        String resultado=null;
        String nombre=this.txtnombremarca.getText();
        if(this.txtnombremarca.toString().isEmpty()||nombre.isEmpty()||nombre==null){
            JOptionPane.showMessageDialog(null, "Debe ingresar un nombre", "Error de datos", JOptionPane.ERROR_MESSAGE);
        }else{
            try{
                Class.forName("com.mysql.jdbc.Driver");
                Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost/BDSis", "root", "");
                Statement st = conexion.createStatement();
                ResultSet rs = st.executeQuery("SELECT * FROM marca WHERE nombre='"+nombre+"'");
                while (rs.next()) {
                    resultado=rs.getObject("nombre").toString().toUpperCase();
                }
                rs.close();
                System.out.println("result="+resultado);
            } catch (SQLException se) {
                System.out.println(se);
            } catch (ClassNotFoundException e) {
                System.out.println(e);
            }
            if(resultado!=null){
                if(resultado.equals(nombre.toUpperCase())){
                    JOptionPane.showMessageDialog(null, "La marca "+nombre+" ya ha sido ingresada...", "Error de datos", JOptionPane.ERROR_MESSAGE);
                    this.txtnombremarca.setText("");
                    this.txtidmarca.setText("");
                } else {
                        data.addMarca(nombre);
                }
            }else{
                data.addMarca(nombre);
            }
            this.updateTablaMarca();

            this.txtnombremarca.setText("");
            this.txtidmarca.setText("");
            this.getComboMarcas();
        }
    }//GEN-LAST:event_btnguardamarcaActionPerformed

    private void tablaMarcaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaMarcaMouseClicked
        // TODO add your handling code here:
        fila = tablaMarca.rowAtPoint(evt.getPoint());
        if (fila > -1){
            this.txtidmarca.setText(String.valueOf(tablaMarca.getValueAt(fila, 0)));
            this.txtnombremarca.setText(String.valueOf(tablaMarca.getValueAt(fila, 1)));
        }
    }//GEN-LAST:event_tablaMarcaMouseClicked

    private void btnguardamodeloActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnguardamodeloActionPerformed
        // TODO add your handling code here:
        String resultado=null;
        String nombre=this.txtnombremodelo.getText();
        if(this.txtnombremodelo.toString().isEmpty()||nombre.isEmpty()||nombre==null){
            JOptionPane.showMessageDialog(null, "Debe ingresar un nombre", "Error de datos", JOptionPane.ERROR_MESSAGE);
        }else if(this.cbMarca.getSelectedItem().toString().equals("Seleccione")){
            JOptionPane.showMessageDialog(null, "Debe seleccionar una marca", "Error de datos", JOptionPane.ERROR_MESSAGE);
        }else{
            try{
                Class.forName("com.mysql.jdbc.Driver");
                Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost/BDSis", "root", "");
                Statement st = conexion.createStatement();
                ResultSet rs = st.executeQuery("SELECT * FROM modelo WHERE nombre='"+nombre+"'");
                while (rs.next()) {
                    resultado=rs.getObject("nombre").toString().toUpperCase();
                }
                rs.close();
                System.out.println("result="+resultado);
            } catch (SQLException se) {
                System.out.println(se);
            } catch (ClassNotFoundException e) {
                System.out.println(e);
            }
            if(resultado!=null){
                if(resultado.equals(nombre.toUpperCase())){
                    JOptionPane.showMessageDialog(null, "El modelo "+nombre+" de "+cbMarca.getSelectedItem().toString()+" ya ha sido ingresada...", "Error de datos", JOptionPane.ERROR_MESSAGE);
                    this.txtnombremodelo.setText("");
                } else {
                        data.addModelo(idMarca, nombre);
                }
            }else{
                data.addModelo(idMarca, nombre);
            }
            this.updateTablaMarca();
            this.txtnombremodelo.setText("");
        }
        this.updateTablaModelo();
        
        this.txtnombremodelo.setText("");
        this.getComboMarcas();
    }//GEN-LAST:event_btnguardamodeloActionPerformed

    private void cbMarcaItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbMarcaItemStateChanged
        // TODO add your handling code here:
        String marca=this.cbMarca.getSelectedItem().toString();
        
        try{
            Class.forName("com.mysql.jdbc.Driver");
            Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost/BDSis", "root", "");
            Statement st = conexion.createStatement();
            ResultSet rs = st.executeQuery("SELECT idMarca FROM marca WHERE nombre='"+marca+"'");
            while (rs.next()) {
                idMarca=Integer.parseInt(rs.getObject("idMarca").toString());
            }
            rs.close();
        } catch (SQLException se) {
            System.out.println(se);
        } catch (ClassNotFoundException e) {
            System.out.println(e);
        }
        
    }//GEN-LAST:event_cbMarcaItemStateChanged

    private void tablaModeloMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaModeloMouseClicked
        // TODO add your handling code here:
        //String idMarcas="";
        fila = tablaModelo.rowAtPoint(evt.getPoint());
        if (fila > -1){
            this.txtidmodelo.setText(String.valueOf(tablaModelo.getValueAt(fila, 0)));
            this.txtnombremodelo.setText(String.valueOf(tablaModelo.getValueAt(fila, 2)));
            idMarca=Integer.parseInt(String.valueOf(tablaModelo.getValueAt(fila, 1)));
        }
        System.out.println("idMarca="+idMarca);
        try{
            Class.forName("com.mysql.jdbc.Driver");
            Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost/BDSis", "root", "");
            Statement st = conexion.createStatement();
            ResultSet rs = st.executeQuery("SELECT nombre FROM marca WHERE idMarca='"+idMarca+"'");
            while (rs.next()) {
                this.cbMarca.setSelectedItem(rs.getObject("nombre").toString());
            }
            rs.close();
        } catch (SQLException se) {
            System.out.println(se);
        } catch (ClassNotFoundException e) {
            System.out.println(e);
        }
    }//GEN-LAST:event_tablaModeloMouseClicked

    private void btnmodificamarcaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnmodificamarcaActionPerformed
        // TODO add your handling code here:
        String idMarcas=this.txtidmarca.getText();
        String nombre=this.txtnombremarca.getText();
        
        data.updateMarcas(idMarcas, nombre);
        this.updateTablaMarca();
        this.txtidmarca.setText("");
        this.txtnombremarca.setText("");
    }//GEN-LAST:event_btnmodificamarcaActionPerformed

    private void btnmodificamodeloActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnmodificamodeloActionPerformed
        // TODO add your handling code here:
        String idModelo=this.txtidmodelo.getText();
        String nombre=this.txtnombremodelo.getText();
        
        data.updateModelos(idModelo, idMarca, nombre);
        this.updateTablaMarca();
        this.updateTablaModelo();
        this.getComboMarcas();
        this.txtidmodelo.setText("");
        this.txtnombremodelo.setText("");
        this.cbMarca.setSelectedIndex(0);
    }//GEN-LAST:event_btnmodificamodeloActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnguardamarca;
    private javax.swing.JButton btnguardamodelo;
    private javax.swing.JButton btnmodificamarca;
    private javax.swing.JButton btnmodificamodelo;
    private javax.swing.JComboBox cbMarca;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable tablaMarca;
    private javax.swing.JTable tablaModelo;
    private javax.swing.JTextField txtidmarca;
    private javax.swing.JTextField txtidmodelo;
    private javax.swing.JTextField txtnombremarca;
    private javax.swing.JTextField txtnombremodelo;
    // End of variables declaration//GEN-END:variables
}
